import Vue from 'vue'
import VueRouter from 'vue-router'
import HomeView from '../views/HomeView.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    component: () => import(/* webpackChunkName: "about" */ '../views/HomeView.vue'),
    //redirect:'index',
    children:[
      {
        path: 'index',
        name: 'index',
        component: () => import(/* webpackChunkName: "about" */ '../views/index.vue')
      },
      {
        path: '/articleDetail/:id',
        name: 'ArticleDetail',
        component: () => import(/* webpackChunkName: "about" */ '../views/article/ArticleDetail.vue')
      },
      {
        path: '/article',
        name: 'Article',
        component: () => import(/* webpackChunkName: "about" */ '../views/article/Article.vue')
      },
      {
        path: '/about',
        name: '/About',
        component: () => import(/* webpackChunkName: "about" */ '../views/about/About.vue')
      },
      {
        path: '/questionDetail/:id',
        name: 'QuestionDetail',
        component: () => import(/* webpackChunkName: "about" */ '../views/question/QuestionDetail.vue')
      },
      {
        path: '/question',
        name: 'Question.vue',
        component: () => import(/* webpackChunkName: "about" */ '../views/question/Question.vue')
      },
      {
        path: '/course',
        name: 'Course.vue',
        component: () => import(/* webpackChunkName: "about" */ '../views/course/Course.vue')
      },
      {
        path: '/courseDetail/:id',
        name: 'CourseDetail.vue',
        component: () => import(/* webpackChunkName: "about" */ '../views/course/CourseDetail.vue')
      },
      {
        path: '/teacherDetail/:id',
        name: 'TeacherDetail.vue',
        component: () => import(/* webpackChunkName: "about" */ '../views/teacher/TeacherDetail.vue')
      },
      {
        path: '/teacher',
        name: 'Teacher.vue',
        component: () => import(/* webpackChunkName: "about" */ '../views/teacher/Teacher.vue')
      },
      {
        path: 'person',
        name: '个人信息',
        component: () => import(/* webpackChunkName: "about" */ '../views/user/Person.vue')
      },
      {
        path: 'updatePassword',
        name: '修改密码',
        component: () => import(/* webpackChunkName: "about" */ '../views/user/UpdatePassword.vue')
      },
      {
        path: 'resources',
        name: '资源',
        component: () => import(/* webpackChunkName: "about" */ '../views/resources/Resources.vue')
      },
      {
        path: 'publishArticle',
        name: '发布文章',
        component: () => import(/* webpackChunkName: "about" */ '../views/article/PubLishArticle.vue')
      },
      {
        path: 'publishQuestion',
        name: '发布问答',
        component: () => import(/* webpackChunkName: "about" */ '../views/question/PubLishQuestion.vue')
      },

      {
        path: 'publishCourse',
        name: '发布课程',
        component: () => import(/* webpackChunkName: "about" */ '../views/course/PublishCourse.vue')
      },{
        path: 'publishChapter',
        name: '发布章节',
        component: () => import(/* webpackChunkName: "about" */ '../views/course/PublishChapter.vue')
      },{
        path: 'publishSection',
        name: '发布小节',
        component: () => import(/* webpackChunkName: "about" */ '../views/course/PublishSection.vue')
      },{
        path: 'myComment',
        name: '我的评论',
        component: () => import(/* webpackChunkName: "about" */ '../views/user/MyComment.vue')
      },
      {
        path: 'assiant',
        name: '学习助手',
        component: () => import(/* webpackChunkName: "about" */ '../views/user/StudyAssiant.vue')
      },
      {
        path: 'myLike',
        name: '我的点赞',
        component: () => import(/* webpackChunkName: "about" */ '../views/user/MyLike.vue')
      },
      {
        path: 'myCollect',
        name: '我的收藏',
        component: () => import(/* webpackChunkName: "about" */ '../views/user/MyCollect.vue')
      },
      {
        path: 'myPublish',
        name: '我的发布',
        component: () => import(/* webpackChunkName: "about" */ '../views/user/MyPublish.vue')
      },
    ]
  },

]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
